package com.itheima.d2_buffered_stream;

import java.io.*;

public class BufferedInputStreamTest1 {
    public static void main(String[] args) {
        try (
                InputStream is = new FileInputStream("Day18-io-app\\src\\itheima02.txt");
                BufferedInputStream bis = new BufferedInputStream(is, 8192 * 2);
                OutputStream os = new FileOutputStream("Day18-io-app\\src\\itheima02_OutPut.txt");
                BufferedOutputStream bos = new BufferedOutputStream(os, 8292 * 2);


        ) {
            byte[] bytes = new byte[1024];
            int len;
            while ((len = bis.read(bytes)) != -1) {
                bos.write(bytes, 0, len);
            }

            System.out.println("拷贝成功!");
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
